<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			#div{
				width: 1000px;
				padding: 20px,0px;
				border-top:  1px red solid;
				border-bottom:  1px red solid;
			}
			
			
		</style>
	</head>
	<body>
		<div id="div">
			
		<p>工作经历</p>

		公司名称：<input type="" name="username" id="username" value="" /> 
		职位：<input type="" name="" id="" value="" />
		<button type="button" onclick="delson()">删除</button>
		<br />
		<table border="0" cellspacing="" cellpadding="">
			<tr>
				<td>工作职责及工作内容描述：</td>
				<td><textarea rows="5" cols="50"></textarea></td>
			</tr>
			
		</table>

		<button type="button" onclick="addson()">添加</button>
		</div>
	</body>
	<script type="text/javascript">
	     function addson(){
			 var divobj=document.getElementById('div')
			 divobj.innerHTML+=`
			 <div id='div2'>
			 <p>工作经历</p>
			 
			 公司名称：<input type="" name="username" id="username" value="" /> 
			 职位：<input type="" name="" id="" value="" />
			 <button type="button" onclick="delson()">删除</button>
			 <br />
			 <table border="0" cellspacing="" cellpadding="">
			 	<tr>
			 		<td>工作职责及工作内容描述：</td>
			 		<td><textarea rows="5" cols="50"></textarea></td>
			 	</tr>
			 	
			 </table>
			 
			 <button type="button" onclick="addson()">添加</button>
			 `
		 }
	
	    function delson(){
			var divobj=document.getElementById('div');
			var div2obj=document.getElementById('div2');
			divobj.removeChild(div2obj)
		}
	
	
	
		// function getdiv2(){
		// 	var usernameinputs=document.getElementsByName('username')
		// 	console.log(usernameinputs)
		// }
	</script>
</html>
